package com.neu.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neu.entity.Disease;
import com.neu.mapper.DiseaseMapper;
import com.neu.service.DiseaseService;





@Service
public class DiseaseServiceImpl implements DiseaseService{
	@Autowired
	private DiseaseMapper diseaseMapper;
	@Override
	public List<Disease> getdiseaseInfo(int diseCategoryID,int page,int limit) {
		// TODO Auto-generated method stub
		return diseaseMapper.getdiseaseInfo(diseCategoryID,page,limit);
	}
	@Override
	public int getdiseaseInfoTotal(int diseCategoryID) {
		// TODO Auto-generated method stub
		return diseaseMapper.getdiseaseInfoTotal(diseCategoryID);
	}
	@Override
	public boolean addDisease(Disease disease) {
		// TODO Auto-generated method stub
		int save = diseaseMapper.addDisease(disease);
		boolean flag = false;
		if(save>0) {
			flag = true;
		}
		return flag;
	}
	@Override
	public boolean delDiseaseByIds(Integer[] ids) {
		// TODO Auto-generated method stub
		int dels = diseaseMapper.delDiseaseByIds(ids);
		return dels==ids.length;
	}
	@Override
	public boolean updateDisease(Disease disease) {
		// TODO Auto-generated method stub
		int upd = diseaseMapper.updateDisease(disease);
		boolean flag = false;
		if(upd>0) {
			flag = true;
		}
		return flag;
	}
	@Override
	public Integer[] getDiseaseIds(int diseCategoryID) {
		// TODO Auto-generated method stub
		return diseaseMapper.getDiseaseIds(diseCategoryID);
	}

}
